package top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yfq
 * @date 2024/6/11 13:34
 * @description 授权登录类型
 */
@Getter
@AllArgsConstructor
public enum Oauth2Type {
    ALIPAY(1, "支付宝"),
    WE_CHAT(2, "微信");

    private final int type;
    private final String desc;

    public static Oauth2Type determineOauth2Type(int type) {
        for (Oauth2Type value : Oauth2Type.values()) {
            if (value.getType() == type) return value;
        }

        return null;
    }
}
